<!-- inc:head -->
<script type="text/javascript" src="js/layer.js"></script>
<script type="text/javascript" src="js/php.js"></script>
<div id="body">
	<div id="left">
		<div id="user_cp"><div class="loading"></div></div>
	</div>
	<div id="right">
		<div class="block-title">{:$m_rs[title]} - 添加<!-- if($_SESSION[user_id]) --> &nbsp; ( <a href="{:site_url('post,list')}module_id={:$m_rs[id]}">列表</a> )<!-- end --></div>
		<div class="block-msg">
			<form method="post" action="{:site_url('post,setok')}id={:$id}&module_id={:$module_id}" onsubmit="return to_submit();">
			<div class="table">
				<div class="left"><span class="red">*</span> 主题：</div>
				<input type="text" name="subject" id="subject" class="long_input" value="{:$rs[title]}">
			</div>
			<!-- if($m_rs[if_url_m]) -->
			<div class="table">
				<div class="left"><span class="red">*</span> 链接网址：</div>
				<input type="text" name="link_url" id="link_url" class="long_input" value="{:$rs[link_url]}">
				<select name="target" id="target">
				<option value="0">当前窗口</option>
				<option value="1">新窗口</option>
				</select>
			</div>
			<!-- end -->
			<!-- if($ifcate) -->
			<div class="table">
				<div class="left"><span class="red">*</span> 分类：</div>
				{:$cate_html}
			</div>
			<!-- end -->
			<!-- if($m_rs[if_thumb]) -->
			<input type="hidden" name="thumb_id" id="thumb_id" value="{:$rs[thumb_id]}">
			<div class="table">
				<div class="left">
					<div style="padding-bottom:3px;"><!-- if($m_rs[if_thumb_m]) --><span class="red">*</span> <!-- end -->缩略图：</div>
					<div style="padding-bottom:3px;"><input type="button" class="button" value="选择" onclick="phpjs_img('thumb_id','thumb_view');" /> &nbsp;</div>
					<input type="button" value="删除" class="button" onclick="phpjs_clear_img('thumb_id','thumb_view')" /> &nbsp;
				</div>
				<table cellpadding="0" cellspacing="0">
				<tr>
					<td align="left" id="thumb_view"><!-- if($rs[thumb]) --><img src="{:$rs[thumb]}" border="0" /><!-- else --><img src="images/nopic.gif" border="0" /><!-- end --></td>
				</tr>
				</table>
			</div>
			<!-- end -->
			<!-- $extlist_must AS $key=>$value -->
			{:$value}
			<!-- end -->

			<div {if(!$m_rs[if_biz])} style="display:none;"{end}>
				<div class="table">
					<div class="left">售价：</div>
					<input type="text" name="price" id="price" value="{:$rs[price]}">
					<span class="clue_on"> RMB</span>
				</div>
				<div class="table">
					<div class="left">虚拟产品：</div>
					<input type="checkbox" name="virtual" id="virtual" value="1"{if($rs[virtual])} checked{end}>
					<span class="clue_on"> 如果该产品是虚拟产品，请打上勾（购买虚拟产品不需填写地址，不计运费）</span>
				</div>
				<div class="table">
					<div class="left">特价：</div>
					<input type="checkbox" name="ifspecial" id="ifspecial" value="1"{if($rs[ifspecial])} checked{end}>
					<span class="clue_on"> 如果该价格是特价产品，请打上勾</span>
				</div>
				<div class="table">
					<div class="left">免费：</div>
					<input type="checkbox" name="free" id="free" value="1"{if($rs[free])} checked{end}>
					<span class="clue_on"> 如果该产品免费，请打上勾</span>
				</div>
				<div class="table">
					<div class="left">重量：</div>
					<input type="text" name="weight" id="weight" class="short_input" value="{:$rs[weight]}">
					<span class="clue_on"> 单位是：Kg</span>
				</div>
			</div>

			<!-- $extlist_need AS $key=>$value -->
			{:$value}
			<!-- end -->
	
			<div class="table">
				<div class="left">&nbsp;</div>
				<input type="submit" class="button" id="_phpok_submit" name="article_submit" value=" 提交 ">
			</div>
		
		</div>
	</div>
	<div class="space clear"></div>
</div>
<script type="text/javascript">
func_php("usercp",js_usercp,"user_cp");
<!-- $extlist AS $key=>$value -->
	<!-- if($value[input] == "opt") -->
	phpjs_parent_opt('{:$value[default_val]}','{:$value[identifier]}','{:$value[id]}');
	<!-- elseif($value[input] == "img") -->
	phpjs_viewpic('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "download") -->
	phpjs_viewdown('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "video") -->
	phpjs_viewvideo('{:$value[default_val]}','{:$value[identifier]}');
	<!-- end -->
<!-- end -->

function to_submit()
{
	var subject = getid("subject").value;
	if(!subject)
	{
		alert("主题不允许为空");
		getid("subject").focus();
		return false;
	}
	//判断核心模块是否必填
	<!-- if($ifcate) -->
	var cate_id = getid("cate_id").value;
	if(!cate_id || cate_id == "0")
	{
		alert("请选择分类");
		return false;
	}
	<!-- end -->
	<!-- if($m_rs[if_thumb] && $m_rs[if_thumb_m]) -->
	var thumb_id = getid("thumb_id").value;
	if(!thumb_id)
	{
		alert("请选择缩略图信息");
		return false;
	}
	<!-- end -->
	<!-- $extlist AS $key=>$value -->
	<!-- if($value[if_must] && $value[input] != "radio" && $value[input] != "checkbox") -->
		<!-- if($value[input] != "edit") -->
		var {:$value[identifier]} = getid("{:$value[identifier]}").value;
		<!-- else -->
		var oEditor_{:$value[identifier]} = FCKeditorAPI.GetInstance('{:$value[identifier]}');
		var {:$value[identifier]} = oEditor_{:$value[identifier]}.GetXHTML(true);
		<!-- end -->
		if(!{:$value[identifier]})
		{
			alert("{:$value['error_note'] ? $value['error_note'] : '所有加红色星号信息均必须填写'}");
			return false;
		}
	<!-- end -->
	<!-- end -->
	getid("_phpok_submit").disabled = true;
	return true;
}
</script>
<!-- inc:foot -->